package com.shujia.scala

object Demo33implicit {
  def main(args: Array[String]): Unit = {
    //1、隐式转换参数
    def split(str: String)(implicit seq: String): List[String] = {
      str.split(seq).toList
    }

    val words: List[String] = split("java,spark,spark")(",")

    println(words)

    //2、隐式转换变量
    implicit val seq: String = "\\|"

    //隐式转换变量会自动填充隐式转换参数
    val strings: List[String] = split("java|hadoop|hive")
    println(strings)
  }
}
